<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>${pageTitle != null ? pageTitle : '用户中心'}</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        
        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background: #f5f5f5;
            min-height: 100vh;
            color: #1a1a1a;
        }
        
        .layout {
            display: flex;
            min-height: 100vh;
        }
        
        .sidebar {
            width: 280px;
            background: #1a1a1a;
            color: #fff;
            box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
            position: relative;
            overflow: hidden;
        }
        
        .sidebar::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 4px;
            background: #333;
        }
        
        .sidebar h2 {
            font-size: 24px;
            margin: 0;
            padding: 30px 0 20px 40px;
            letter-spacing: 1px;
            color: #fff;
            font-weight: 700;
        }
        
        .nav {
            list-style: none;
            padding: 0;
            margin: 0;
        }
        
        .nav li {
            margin: 0;
        }
        
        .nav a {
            display: flex;
            align-items: center;
            color: #ccc;
            text-decoration: none;
            padding: 16px 40px;
            transition: all 0.3s ease;
            position: relative;
            font-weight: 500;
        }
        
        .nav a:hover {
            background: rgba(255, 255, 255, 0.1);
            color: #fff;
            transform: translateX(5px);
        }
        
        .nav .active {
            background: rgba(255, 255, 255, 0.15);
            color: #fff;
            border-right: 3px solid #fff;
        }
        
        .nav a::before {
            content: '';
            position: absolute;
            left: 0;
            top: 0;
            bottom: 0;
            width: 0;
            background: #fff;
            transition: width 0.3s ease;
        }
        
        .nav a:hover::before,
        .nav .active::before {
            width: 4px;
        }
        
        .nav-icon {
            margin-right: 12px;
            font-size: 18px;
            width: 20px;
            text-align: center;
        }
        
        .content {
            flex: 1;
            padding: 40px 50px;
            background: #f8f8f8;
            overflow-y: auto;
        }
        
        .content-header {
            margin-bottom: 30px;
        }
        
        .content-title {
            font-size: 28px;
            font-weight: 600;
            color: #1a1a1a;
            margin-bottom: 10px;
        }
        
        .content-subtitle {
            color: #666;
            font-size: 16px;
        }
        
        .profile-actions {
            margin-top: 24px;
        }
        
        .profile-actions a,
        .profile-actions button {
            margin-right: 16px;
            padding: 8px 16px;
            border-radius: 6px;
            text-decoration: none;
            font-weight: 500;
            transition: all 0.3s ease;
        }
        
        .profile-actions a:hover,
        .profile-actions button:hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        }
        
        /* 响应式设计 */
        @media (max-width: 768px) {
            .layout {
                flex-direction: column;
            }
            
            .sidebar {
                width: 100%;
                height: auto;
            }
            
            .content {
                padding: 20px;
            }
        }
        
        /* 滚动条美化 */
        .content::-webkit-scrollbar {
            width: 8px;
        }
        
        .content::-webkit-scrollbar-track {
            background: #f1f1f1;
            border-radius: 4px;
        }
        
        .content::-webkit-scrollbar-thumb {
            background: #c1c1c1;
            border-radius: 4px;
        }
        
        .content::-webkit-scrollbar-thumb:hover {
            background: #a8a8a8;
        }
    </style>
</head>
<body>
<div class="layout">
    <div class="sidebar">
        <h2>知识库</h2>
        <ul class="nav">
            <li>
                <a href="/user/space" class="${activePage == 'space' ? 'active' : ''}">
                    <span class="nav-icon">🏠</span>
                    个人空间
                </a>
            </li>
            <li>
                <a href="/user/docs" class="${activePage == 'docs' ? 'active' : ''}">
                    <span class="nav-icon">📄</span>
                    我的文档
                </a>
            </li>
            <li>
                <a href="/user/favorites" class="${activePage == 'favorites' ? 'active' : ''}">
                    <span class="nav-icon">⭐</span>
                    我的收藏
                </a>
            </li>
            <li>
                <a href="/user/profile" class="${activePage == 'profile' ? 'active' : ''}">
                    <span class="nav-icon">👤</span>
                    个人资料
                </a>
            </li>
        </ul>
    </div>
    <div class="content">
        <c:import url="${contentPage}" />
    </div>
</div>
</body>
</html> 